package com.omg.persistence.dao.lifepoint.sqlmapdao;

import java.util.List;

import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import com.omg.persistence.dao.lifepoint.entity.LPMessageRelation;
import com.omg.persistence.dao.lifepoint.iface.LPMessageRelationDao;

/**
 * 
 * @author roger
 * 
 */
public class LPMessageRelationSqlMapDao extends SqlMapDaoTemplate implements
		LPMessageRelationDao {

	public LPMessageRelationSqlMapDao(DaoManager daoManager) {
		super(daoManager);
	}

	@Override
	public int addLPMessageRelation(LPMessageRelation lpMessageRelation) {
		try {
			this.insert("addLPMessageRelation", lpMessageRelation);
			return 0;
		} catch (Exception e) {
			e.printStackTrace();
			return -1;
		}
	}

	@Override
	public List<LPMessageRelation> getLPMessageRelationsByMessageId(
			String messageid) {
		return this.queryForList("getLPMessageRelationsByMessageId", messageid);
	}

}
